import instance from "@/util/axios.js"
/**
 * 查询保洁人员信息
 * @param {number} page 页码
 * @param {number} limit 每页多少条
 * @param {string} cleaningNumber 员工编号
 * @param {string} cleaningName 员工姓名
 * @param {number} isRegion 是否有工作区域
 */
export const getCleaning = async ({page,limit,cleaningNumber,cleaningNamem,isRegion}) =>
await instance.get("/api/super/cleaning",{
    params: {
        page,
        limit,
        cleaningNumber,
        cleaningNamem,
        isRegion
    }
})
/**
 * 分配保洁人员
 * @param {number} floorId 楼层id
 * @param {number} cleaningId 保洁id
 */
export const allCleaning = async ({floorId,cleaningId}) =>
await instance.put("/api/super/allCleaning",{floorId,cleaningId})

/**
 * 修改楼层保洁人员
 * @param {number} floorId 楼层id
 * @param {number} oldCleaningId 旧的保洁人员id
 * @param {number} newCleaningId 新的保洁人员id
 */
export const updateFCleaning = async ({floorId,oldCleaningId,newCleaningId}) => 
await instance.put("/api/super/updateFCleaning",{floorId,oldCleaningId,newCleaningId})

/**
 * 退出楼层保洁人员
 * @param {number} floorId 楼层id
 * @param {number} cleaningId 保洁人员id
 */
export const quitFloorCleaning = async ({floorId,cleaningId}) => 
await instance.put("/api/super/quitFloorCleaning",{floorId,cleaningId})